home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / amazin1a / form5.frm < prev    next >
Text File  |  1999-09-10  |  3KB  |  117 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form Form5 
  4.    Caption         =   "Description"
  5.    ClientHeight    =   5805
  6.    ClientLeft      =   60
  7.    ClientTop       =   390
  8.    ClientWidth     =   4635
  9.    LinkTopic       =   "Form5"
  10.    ScaleHeight     =   5805
  11.    ScaleWidth      =   4635
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton Command3 
  14.       Caption         =   "Save"
  15.       Height          =   375
  16.       Left            =   1800
  17.       TabIndex        =   3
  18.       Top             =   5400
  19.       Width           =   1335
  20.    End
  21.    Begin MSComDlg.CommonDialog CommonDialog1 
  22.       Left            =   4680
  23.       Top             =   5280
  24.       _ExtentX        =   847
  25.       _ExtentY        =   847
  26.       _Version        =   393216
  27.    End
  28.    Begin VB.CommandButton Command2 
  29.       Caption         =   "Copy"
  30.       Height          =   375
  31.       Left            =   120
  32.       TabIndex        =   2
  33.       Top             =   5400
  34.       Width           =   1575
  35.    End
  36.    Begin VB.CommandButton Command1 
  37.       Caption         =   "Quit"
  38.       Height          =   375
  39.       Left            =   3240
  40.       TabIndex        =   1
  41.       Top             =   5400
  42.       Width           =   1335
  43.    End
  44.    Begin VB.TextBox Text1 
  45.       Height          =   5295
  46.       Left            =   0
  47.       MultiLine       =   -1  'True
  48.       ScrollBars      =   3  'Both
  49.       TabIndex        =   0
  50.       Top             =   0
  51.       Width           =   4575
  52.    End
  53. End
  54. Attribute VB_Name = "Form5"
  55. Attribute VB_GlobalNameSpace = False
  56. Attribute VB_Creatable = False
  57. Attribute VB_PredeclaredId = True
  58. Attribute VB_Exposed = False
  59.  
  60. Private Sub Command1_Click()
  61. Unload Me
  62. End Sub
  63.  
  64. Private Sub Command2_Click()
  65. MsgBox "Put copy to clipboard code HERE!"
  66. End Sub
  67.  
  68. Private Sub Command3_Click()
  69. Dim file1
  70. file:
  71. CommonDialog1.Filter = "(*.txt)|*.txt|"
  72. CommonDialog1.ShowSave
  73. If CommonDialog1.filename = "" Then
  74.   MsgBox "You did not enter any file name !"
  75.   Exit Sub
  76. Else
  77. Dim Strtemp, rep2
  78. rep2 = Dir(CommonDialog1.filename)
  79. Strtemp = Mid(CommonDialog1.filename, (Len(CommonDialog1.filename) - Len(rep2)) + 1, Len(rep2))
  80.  If rep2 = Strtemp Then
  81.    Dim rep
  82.    rep = MsgBox("The file already exist do you want to replace it ?", vbQuestion + vbYesNoCancel, "File Overwrite !!")
  83.    If rep = vbNo Then
  84.      GoTo file:
  85.    ElseIf rep = vbYes Then
  86.      Kill CommonDialog1.filename
  87.    Else
  88.      Exit Sub
  89.    End If
  90.  End If
  91.  file1 = FreeFile
  92.  EndStatement = "End Sub"
  93.  If InStr(1, StringToFind, "Function") <> 0 Then EndStatement = "End Function"
  94.  Open CommonDialog1.filename For Output As file1
  95.  Write #file1, Text1.Text
  96.  Close file1
  97.   
  98. End If
  99.  
  100.  
  101. End Sub
  102.  
  103. Private Sub Form_Load()
  104.  Me.Caption = StringToFind
  105. End Sub
  106.  
  107.  
  108. Private Sub Form_Resize()
  109. If Me.WindowState <> 1 Then
  110. Text1.Width = Width - 150
  111. Text1.Height = Height - 1200
  112. Command1.Top = Height - 915
  113. Command2.Top = Height - 915
  114. Command3.Top = Height - 915
  115. End If
  116. End Sub
  117.